#include <57header.h>

int main(int argc,char*argv[])
{

    char *port = "8080";
    char *ip = "192.168.106.129";

    int fd = socket(AF_INET, SOCK_STREAM, 0);

    struct sockaddr_in sockaddr;
    sockaddr.sin_family = AF_INET;
    sockaddr.sin_port = htons(atoi(port));
    sockaddr.sin_addr.s_addr = inet_addr(ip);

    bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr));

    listen(fd, 10);


    int net_fd = accept(fd, NULL, NULL);
    
    char buf[60] = {0};
    recv(net_fd, buf, sizeof(buf), 0);

    printf("serve: %s \n", buf);


    close(net_fd);
    close(fd);
    return 0;
}

